<!doctype html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"> 
<meta content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" name="viewport" />
<title>注册信息</title>
<link href="__PUBLIC__/index/css/sign3.css" type="text/css" rel="stylesheet">
<script type="text/javascript" src="__PUBLIC__/index/js/jquery-1.8.1.js"></script>
<!-- 引入微信的js -->
<script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
<link href="__PUBLIC__/index/css/css.css" type="text/css" rel="stylesheet">

<script type="text/javascript" src="__PUBLIC__/index/js/alert.js"></script>
</head>

<body>
  <div class="layout2">
            <span><img src="__PUBLIC__/index/image/logo.png" width="120" height="35" /></span>
            <form method="post" id="register">
            <ul>
                <p class="err_msg"></p>
              
                  <li><i class="pw"></i>
                  <input class="username2" type="text" id="user" name="name" value="{$name}" placeholder="怎样称呼您" />
                  <!-- 隐藏域的值 begin-->
                  <input type="hidden" name="phone" value="{$phone}" />
                  <input type="hidden" name="openid" value="{$openid}" />
                  <input type="hidden" name="password" value="{$password}" />
                  <!-- 隐藏域的值 end-->

                    <label class="radio">女士
                    <input type="radio" name="sex" value="2"  <if condition="$sex eq '2'"> checked="checked"</if> /><i></i></label> 
                    <label class="radio">先生
                    <input type="radio" value="1" name="sex" <if condition="$sex eq '1'"> checked="checked"</if> /><i></i></label>  
                    <li><i class="pw"></i>
                           <select class="yzm2" form="register" name="plot" id="plot"> 
                                 <option value ="0">请选择小区</option>  
                                <!--  <option value ="{$plot.id}" id="p" >{$plot.name}</option>   -->
                                 <volist name="list" id="data"> 
                                     <option value ="{$data['id']}" <if condition="$plot['id'] eq $data['id']">selected="selected"</if> >{$data['name']}</option>  
                                 </volist>
                           </select> 
                     </li>
               
            </ul>
                 <div class="reg_btn">
                    <button type="button" class="submit" onClick="checksubmit();">完成</button>
                </div>
            </form>
        </div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(e) {
  var height=document.documentElement.clientHeight;
  var width=document.documentElement.clientWidth;
  $(".layout2").css({"height":height,"width":width});

  var plot=$("#plot").val();
  if (plot!=0) {
    hint("系统检测到您已是尚元优家优质用户,请核对以下信息是否正确");
  }else{
      $("#p").hide();
  }
});
// 去除微信右上角的点点点
wx.config({
    debug: false,
    appId: "{$sign.appId}",
    timestamp:"{$sign.timestamp}",
    nonceStr:"{$sign.nonceStr}",
    signature:"{$sign.signature}",
    jsApiList: [
        'wx.hideOptionMenu',
      ]
});
wx.checkJsApi({
    jsApiList: [
        'getLocation'
    ],
    success: function (res) {
  
        if (res.checkResult.getLocation == false) {
            alert('你的微信版本太低，不支持微信JS接口，请升级到最新的微信版本！');
            return;
        }
    }
});
//隐藏微信右上角
wx.ready(function () {
   wx.hideOptionMenu();
    
});  
  function checksubmit(){
    //验证姓名不为空
    var user=$("#user").val();
    if (user=="") {
      hint("姓名不能为空");
      return false;
    };
    //$('#register').submit();
     $.ajax({
                cache: true,
                type: "POST",
                url:'{:U("Register/register")}',
                data:$('#register').serialize(),
                async: false,
                error: function(request) {
                    alert("失败");
                },
                success: function(data) {
                     hint('恭喜');
                    /*wx.ready(function () {
                      wx.closeWindow();
                      });*/
                     setTimeout(function() {
                    window.location.href='http://sunwayuchoice.com/index.php/Enter/index';
                    }, 2000);
                   }
               });
  }

</script>
